<!DOCTYPE html>
<html>
<head>
<title>Template</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css"/>
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-icon.css"/>
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-revise.css"/>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript" src="../ext/ext-revise.js"></script>
<script type="text/javascript" src="../ext/src/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="../ext/adapter/ux/ComboBoxTree.js"></script>
</head>

<body>
<script type="text/javascript">
Ext.QuickTips.init();

var form = new Ext.form.FormPanel({
	renderTo: Ext.getBody(),
	frame: true,
    labelWidth: 150,
    items: [{
        xtype: "combo",
        hiddenName: "boolean",
        fieldLabel: "Local ComboBox",
        store: new Ext.data.SimpleStore({
            fields: ["value", "text"],
            data: [
                ["1", "True"],
                ["2", "False"]
            ]
        }),
        mode: "local",
        editable: false,
        allowBlank: false,
        emptyText: "--select--",
        valueField: "value",
        displayField: "text",
        triggerAction: "all",
        selectOnFocus: true,
        blankText: "please select an option."
    }, {
        xtype: "combo",
        hiddenName: "combobox",
        fieldLabel: "Remote ComboBox",
        store: new Ext.data.Store({
            proxy: new Ext.data.HttpProxy({
                url: "/struts2-extjs3/combo/combobox.do",
                method: "POST"
            }),
            reader: new Ext.data.JsonReader({
                totalProperty: "total",
                root: "result",
                fields: [
                    {name: "value"},
                    {name: "text"}
                ]
            })
        }),
        mode: "remote",
        editable: false,
        allowBlank: false,
        emptyText: "--select--",
        valueField: "value",
        displayField: "text",
        triggerAction: "all",
        selectOnFocus: true,
        blankText: "please select an option."
    }, {
        xtype: "combo",
        hiddenName: "combolist",
        fieldLabel: "Remote ComboList",
        store: new Ext.data.Store({
        	baseParams: {start: 0, limit: 10},
            proxy: new Ext.data.HttpProxy({
                url: "/struts2-extjs3/combo/combolist.do",
                method: "POST"
            }),
            reader: new Ext.data.JsonReader({
                totalProperty: "total",
                root: "result",
                fields: [
                    {name: "value"},
                    {name: "text"}
                ]
            })
        }),
        mode: "remote",
        editable: false,
        allowBlank: false,
        emptyText: "--select--",
        valueField: "value",
        displayField: "text",
        triggerAction: "all",
        selectOnFocus: true,
        blankText: "please select an option.",
        pageSize: 10,
        listWidth: 220
    }]
});

var button = new Ext.Button({
    renderTo: Ext.getBody(),
    text: "Get Values",
    handler: function() {
        Ext.Msg.alert("Values Dialog", Ext.encode(form.getForm().getValues()));
    }
});
</script>
</body>
</html>
